<style>
.layui-form-pane .layui-form-label{width:auto;}
.layui-form-item{margin-bottom: 0px;}
.layui-table-cell{padding:3px 6px;font-size:13px;line-height:24px;white-space:normal;}
.layui-table-view .layui-table td, .layui-table-view .layui-table th{padding:1px 0px;}

</style>
<div class="page-toolbar">
        <div class="page-filter fl">
            <form class="layui-form layui-form-pane" action="{:url()}" method="get" id="hisi-table-search">
            <div class="layui-form-item">
                <label class="layui-form-label">搜索</label>
                <div class="layui-input-inline">
                    <input type="text" name="keyword" lay-verify="required" placeholder="输入关键词，按回车搜索" class="layui-input">
                </div>
            </div>
            </form>
        </div>
    </div>

    <table id="dataTable"></table>
    
    {include file="system@block/layui" /}
    <script type="text/html" id="statusTpl">
        <input type="checkbox" name="status" value="{{ d.status }}" lay-skin="switch" lay-filter="switchStatus" lay-text="正常|关闭" {{ d.status == 1 ? 'checked' : '' }} {{ d.system == 1 ? 'disabled' : '' }} data-href="{:url('status')}?id={{ d.id }}">
    </script>
    <script type="text/html" title="操作按钮模板" id="buttonTpl">
            <a href="{:url('setProjectUser')}?projectId={{ d.id }}" class="layui-btn layui-btn-xs layui-btn-normal hisi-iframe" title="设置成员" hisi-data="{width: '700px', height: '500px'}">设置成员</a><a href="{:url('edit')}?id={{ d.id }}" class="layui-btn layui-btn-xs layui-btn-normal hisi-iframe" title="修改" hisi-data="{width: '470px', height: '300px'}">修改</a><a href="{:url('del')}?id={{ d.id }}" class="layui-btn layui-btn-xs layui-btn-danger">{{ d.status == 99 ? '恢复' : '隐藏' }}</a>    
    </script>
    <script type="text/html" id="toolbar">
        <div class="layui-btn-group fl">
            <a href="{:url('add')}" hisi-data="{width: '470px', height: '300px'}" class="layui-btn layui-btn-primary layui-btn-sm layui-icon layui-icon-add-circle-fine hisi-iframe" title="添加项目">&nbsp;添加项目</a>
        </div>
    </script>
    
    <script type="text/html" id="updateStatusTpl">
    {{# if (d.status== '0') { }}   
  		已删除
		{{# } else if(d.status== '1') { }}  
  		<strong>显示中</strong>
		{{# } else if(d.status== '99') { }}  
  		已隐藏
		{{# } else { }}  
  		已完成
		{{# } }}
    </script>
    <script type="text/html" id="createTimeTpl">
        <div>{{layui.util.toDateString(d.create_time * 1000) }}</div>
    </script>
    <script type="text/html" id="updateTimeTpl">
        <div>{{layui.util.toDateString(d.update_time * 1000) }}</div>
    </script>
    <script type="text/javascript">
        layui.use(['table'], function() {
            var table = layui.table;
            table.render({
                elem: '#dataTable'
                ,url: '{:url()}' //数据接口
                ,page: true //开启分页
                ,skin: 'row'
                ,even: true
                ,limit: 20
                ,text: {
                    none : '暂无相关数据'
                }
                ,toolbar: '#toolbar'
                ,defaultToolbar: ['filter', 'exports', 'print']
                ,cols: [[ //表头
                    {type:'checkbox'}
                    ,{field: 'name', title: '项目名'}
                    ,{field: 'remark', title: '备注',width:300}
					,{field: 'nick', title: '已完成/所有任务',templet:function(d){ return d.finish_task_count+'/'+d.all_task_count}}
                    ,{field: 'nick', title: '创建人', width:80}
					,{field: 'audit_id_name', title: '审批人', width:130}
                    ,{field: 'userAll', title: '项目成员',width:300}
                    ,{field: 'status', title: '显示状态',templet:'#updateStatusTpl', width:80}
                    ,{field: 'create_time', title: '操作时间',templet: '#createTimeTpl', width:150}
                    ,{field: 'update_time', title: '更新时间',templet: '#updateTimeTpl', width:100}
                    ,{title: '操作', templet: '#buttonTpl',width:170}
                ]]
            });
        });
    </script>